package com.myapp.struts.personal;

import hibernate.CuentasDAO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

public class CrearCuentaAction extends org.apache.struts.action.Action {

    private static final String SUCCESS = "success";

    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {

        CuentaForm f = (CuentaForm) form;
        CuentasDAO cuentasDAO = new CuentasDAO();
        Integer pkCuenta = cuentasDAO.create(f.getCodEntidad(), f.getCodSucursal(), f.getDigito(), f.getTipoCuenta());

     
        


        /*ClientesDAO clienteDAO = new ClientesDAO();
        Clientes cliente = clienteDAO.get(f.getPkCliente());
        Set conjunto = cliente.getCuentasHasClienteses();
        int size = conjunto.size();*/
        
        return mapping.findForward(SUCCESS);
    }
}